package rs.frenjoynet.core.ui.session;

import org.jboss.seam.annotations.*;
import org.jboss.seam.ScopeType;
import org.jboss.seam.log.Log;

import java.io.Serializable;

import rs.frenjoynet.core.core.CoreSecurityFacade;
import rs.frenjoynet.core.core.CoreApplicationsFacade;
import rs.frenjoynet.core.core.ActiveUserSession;
import rs.frenjoynet.core.core.LoginKind;
import rs.frenjoynet.core.ui.FacadeBean;

/**
 * Created by IntelliJ IDEA.
 * User: ppopovic
 * Date: 22.10.2009.
 * Time: 15.46.29
 * To change this template use File | Settings | File Templates.
 */
@Name ("sessionBean")
@Scope (ScopeType.SESSION)
@AutoCreate
@Install (false)
public class UtilisCoreSessionBean implements Serializable
{
	@In (value = "coreSecurityFacadeBean")
	private CoreSecurityFacade coreSecurityFacade;

	@In (value = "coreApplicationsFacadeBean")
	private CoreApplicationsFacade coreApplicationsFacade;

	@In (value = "facadeBean")
	private FacadeBean facadeBean;

	@Logger
	private Log log;

	private LoginKind loginKind;

	public CoreSecurityFacade getCoreSecurityFacade()
	{
		return coreSecurityFacade;
	}

	public CoreApplicationsFacade getCoreApplicationsFacade()
	{
		return coreApplicationsFacade;
	}


	public String getSessionGuid()
	{
		return getCurrentSession().getGuid();
	}

	public ActiveUserSession getCurrentSession()
	{
		return facadeBean.getActiveUserSession();
	}

	public LoginKind getLoginKind()
	{
		return loginKind;
	}

	public void setLoginKind(LoginKind loginKind)
	{
		this.loginKind = loginKind;
	}
}
